package de.schneeug.swep_first_sprint.controller;

import javax.enterprise.context.RequestScoped;
import javax.inject.Named;

import org.jboss.logging.Logger;


import de.schneeug.swep_first_sprint.model.Customer;

@Named
@RequestScoped
public class CustomerController {

	private Customer newCostomer = new Customer();
	
	private Logger logger = Logger.getLogger(CustomerController.class);
	

	public String getFirstName() {
		logger.info(newCostomer.getFirstName() + " was requested!");
		return newCostomer.getFirstName();
		
		
	}

	public void setFirstName(String firstName) {
		this.newCostomer.setFirstName(firstName);
		logger.info(newCostomer.getFirstName() + " was set!");
	}

	public String getLastName() {
		logger.info(newCostomer.getLastName() + " was requested!");
		return newCostomer.getLastName();
	}

	public void setLastName(String lastName) {
	 this.newCostomer.setLastName(lastName);
	 logger.info(newCostomer.getLastName() + " was set!");
	}

	public String save() {
		  return "/showCustomer.xhtml";
		}
}
